export interface VTableProps {
  api?: (...args: any[]) => Promise<any>
  beforeRequest?: (params: any) => Promise<boolean | void>
  afterRequest?: (rows: any) => void
  size?: 'small' | 'large' | 'medium' | 'auto'
  closeDefaultRequest?: boolean
  apiParams?: any
  data?: any[]
  code?: string
  columns?: ColumnType[]
  tabsProps?: TabsPropsType
  switchProps?: SwitchPropsType
  filterOptions?: FilterOptionType[]
  actionOptions?: ActionOptionType[]
  loading?: boolean
  total?: number
  pageSize?: number
  pagerProps?: any
  hidePagination?: boolean
  rowMap?: (row: any, index?: number) => any
}

export interface XTableProps {
  code?: string
  rowData?: any[]
  columns?: ColumnType[]
  hideProps?: string[]
  rowHeight?: number | string
  cellWidth?: number | string
  minCellWidth?: number | string
  enabledTree?: boolean
  enabledExpand?: boolean
  enabledIndex?: boolean
  enabledSort?: boolean
  enabledSelection?: boolean
  enabledSingle?: boolean
  summaryProps?: string[]
  rowKey?: string
  selectable?: (row: any, index?: number) => boolean
}

export interface VFilterProps {
  type: FormComponentType
  props?: any
  label?: string
  models?: ModelType[]
  multiple?: boolean
  className?: string
  width?: number | string
  options?: Array<{
    label: string
    value: string | number | boolean
  }>
}

export interface VColumnProps {
  column: ColumnType
  enabledSort?: boolean
}

export interface TableActionProps {
  actionOptions?: ActionOptionType[]
}

export interface TableFilterProps {
  code?: string
  filterOptions?: FilterOptionType[]
}

export interface TableTabsProps {
  prop?: string
  defaultValue?: number | string
  options?: Array<VTableType & { label: string; value?: number | string }>
}

export interface OperateCellProps {
  row?: any
  rowIndex?: number
  options?: OperateOptionType[]
  hideProp?: string
}
